package cpu;
import type.*;
public class Selector implements Config {
	boolean[][] srcbool; 
	int[] srcint;
	int type;
	int num;
	public Selector(int num, int type){
		this.type = type;
		this.num = num;
		if(type == seleType_boolAr){
			srcbool = new boolean[num][insLength];
			for(int i = 0; i < num; i++){
				srcbool[i] = new boolean[insLength];
			}
		}
		else if(type == seleType_int){
			srcint = new int[num];
		}
	}
	public void setValue(boolean[][] src){
		for(int i = 0 ; i < num; i++){
			copyBoolArray(srcbool[i], src[i]);
		}
	}
	public void setValue(int[] src){
		for(int i = 0 ; i < num; i++){
			srcint[i] = src[i];
		}
	}
	
	public boolean[] selectbool(int i){
		return srcbool[i];
	}
	public int selectint(int i){
		return srcint[i];
	}
	
	private void copyBoolArray(boolean[] dst, boolean[] src){
		for(int i = 0 ; i < src.length; i++){
			dst[i] = src[i];
		}
	}

}
